#include <stdio.h>

int fits_bits(int x, int n){
    
    return (x<=((1<<(n-1))-1)&&x>=(-1<<(n-1)))?1:0; 
}

int main(){
    int x, n;

    printf("Enter two integers: ");
    scanf("%d %d",&x,&n);
    printf("%d",fits_bits(x,n));
    return 0;

}
